package cn.wolfcode.car.business.mapper;

import cn.wolfcode.car.business.domain.Appointment;
import cn.wolfcode.car.business.query.AppointmentQuery;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

public interface AppointmentMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Appointment record);

    Appointment selectByPrimaryKey(Long id);

    List<Appointment> selectAll();

    int updateByPrimaryKey(Appointment record);

    /**
     * 分页查询
     * @param qo
     * @return
     */
    List<Appointment> selectForList(AppointmentQuery qo);

    /**
     *  修改状态
     * @param id
     * @param statusCancel
     */
    void updateStatus(Long id, Integer statusCancel);


    /**
     * 到店时间
     * @param id
     */
    void updateStatusById(@Param("id") Long id, @Param("statusArrival") Integer statusArrival, @Param("actualArrivalTime") LocalDateTime actualArrivalTime);

    /**
     *  查询 状态不为null,展示
     * @param qo
     * @return
     */
    List<Appointment> selectForListAndNotDelete(AppointmentQuery qo);


    /**
     *修改预约单状态
     * @param appointmentId
     * @param statusPaid
     */
    void changeStatus(@Param("id") Long appointmentId, @Param("status") Integer statusPaid);
}